<html>
<head><meta charset="utf-8"><title>Removing `Register::register_macro` compiler extension point · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html">Removing `Register::register_macro` compiler extension point</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="174816424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/174816424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#174816424">(Sep 03 2019 at 18:32)</a>:</h4>
<p>Now that we have proc macros, I wonder if it makes sense to remove this extension point: it seems like it doesn't unlock any additional powers. </p>
<p>However, it's only a convenience wrapper over <code>register_syntax_extension</code>, and that does have some additional knobs. But perhaps we remove the more general thing as well, as those knobs seem very rustc specific. </p>
<p>Context: <a href="https://github.com/rust-lang/rust/pull/64041" target="_blank" title="https://github.com/rust-lang/rust/pull/64041">https://github.com/rust-lang/rust/pull/64041</a> fails due to the change in this interface, and I am waiting for the the stage2 compiler to build to test my fix for the test :)</p>



<a name="174825895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/174825895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#174825895">(Sep 03 2019 at 20:24)</a>:</h4>
<p>Probably after fixing <a href="https://github.com/rust-lang/rust/issues/64132" target="_blank" title="https://github.com/rust-lang/rust/issues/64132">https://github.com/rust-lang/rust/issues/64132</a>.</p>



<a name="174825899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/174825899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#174825899">(Sep 03 2019 at 20:24)</a>:</h4>
<p>(Right now it's also used as an internal helper.)</p>



<a name="176276530"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176276530" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176276530">(Sep 21 2019 at 18:57)</a>:</h4>
<p><span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> <a href="https://github.com/rust-lang/rust/issues/64132" target="_blank" title="https://github.com/rust-lang/rust/issues/64132">#64132</a> was fixed. Do we have an issue to track removal of <code>register_macro/register_syntax_extension</code>?</p>



<a name="176276574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176276574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176276574">(Sep 21 2019 at 18:58)</a>:</h4>
<p>I think checking that <code>servo</code> isn't using them (I think probably the answer is no -- they're mostly using plugins for lints I believe)</p>



<a name="176276581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176276581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176276581">(Sep 21 2019 at 18:58)</a>:</h4>
<p>Once that's done I think we should just remove them (presuming we don't have uses ourselves, which I think is true)</p>



<a name="176276598"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176276598" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176276598">(Sep 21 2019 at 18:59)</a>:</h4>
<p>We'll need at least to change compiler pluging example in the book: it's a roman-numerals macro at the moment</p>



<a name="176276661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176276661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176276661">(Sep 21 2019 at 19:00)</a>:</h4>
<p>I would personally r+ a PR that changes that to say "Plugins will be removed entirely at some point in the future" and remove the example.</p>



<a name="176277471"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176277471" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176277471">(Sep 21 2019 at 19:26)</a>:</h4>
<p>I think we should emit a warning or something when the plugin interface is used</p>



<a name="176279057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176279057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Vadim Petrochenkov <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176279057">(Sep 21 2019 at 20:10)</a>:</h4>
<p><a href="https://www.youtube.com/watch?v=ussCHoQttyQ" target="_blank" title="https://www.youtube.com/watch?v=ussCHoQttyQ">https://www.youtube.com/watch?v=ussCHoQttyQ</a></p>
<div class="youtube-video message_inline_image"><a data-id="ussCHoQttyQ" href="https://www.youtube.com/watch?v=ussCHoQttyQ" target="_blank" title="https://www.youtube.com/watch?v=ussCHoQttyQ"><img src="https://i.ytimg.com/vi/ussCHoQttyQ/default.jpg"></a></div>



<a name="176279231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176279231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176279231">(Sep 21 2019 at 20:15)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> Coding that up seems like it's not worth the effort</p>



<a name="176279235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176279235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176279235">(Sep 21 2019 at 20:15)</a>:</h4>
<p>It's already really painful to do so</p>



<a name="176280125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176280125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176280125">(Sep 21 2019 at 20:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> idk, folks show up every now and then on internals and talk about their plugin</p>



<a name="176280496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Removing%20%60Register%3A%3Aregister_macro%60%20compiler%20extension%20point/near/176280496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Removing.20.60Register.3A.3Aregister_macro.60.20compiler.20extension.20point.html#176280496">(Sep 21 2019 at 20:55)</a>:</h4>
<p>I would be fine replacing the feature gate with servo_plugin or so since they're the only use case we're waiting on to rip them out (and someone should really convince them to move over to their own rustc -- I've even been thinking about suggesting that we pull in their lints to rustc proper as a <code>servo::foo</code> lint, and unstable)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>